import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/main',
      
    },
    {
        path: '/',
        component: resolve => require(['@/components/common/home.vue'], resolve),
        meta: { requireAuth:true, title: '自述文件' },
        children:[
            {path:'/main', name:'MAIN', component: resolve => require(['@/components/pages/main.vue'], resolve),meta: { title: '系统主页',requireAuth:true}}
            ,{path:'/sys/dict/index/:menuId', name:'ZD', component: resolve => require(['@/components/pages/sys/dict/index.vue'], resolve),meta: { title: '字典',requireAuth:true}}
            ,{path:'/sys/field/index/:menuId', name:'ZDPZ', component: resolve => require(['@/components/pages/sys/field/index.vue'], resolve),meta: { title: '字段配置',requireAuth:true}}
            ,{path:'/sys/function/index/:menuId', name:'GNPZ', component: resolve => require(['@/components/pages/sys/function/index.vue'], resolve),meta: { title: '功能配置',requireAuth:true}}
            ,{path:'/sys/log/index/:menuId', name:'RZ', component: resolve => require(['@/components/pages/sys/log/index.vue'], resolve),meta: { title: '日志',requireAuth:true}}
            ,{path:'/sys/menu/index/:menuId', name:'CD', component: resolve => require(['@/components/pages/sys/menu/index.vue'], resolve),meta: { title: '菜单',requireAuth:true}}
            ,{path:'/sys/model/index/:menuId', name:'MKPZ', component: resolve => require(['@/components/pages/sys/model/index.vue'], resolve),meta: { title: '模块配置',requireAuth:true}}
            ,{path:'/sys/privilege/index/:menuId', name:'QXLJ', component: resolve => require(['@/components/pages/sys/privilege/index.vue'], resolve),meta: { title: '权限连接',requireAuth:true}}
            ,{path:'/sys/role/index/:menuId', name:'JS', component: resolve => require(['@/components/pages/sys/role/index.vue'], resolve),meta: { title: '角色',requireAuth:true}}
            ,{path:'/sys/user/index/:menuId', name:'YHXX', component: resolve => require(['@/components/pages/sys/user/index.vue'], resolve),meta: { title: '用户信息',requireAuth:true}}
            ,{path:'/sys/test/index/:menuId', name:'CSCD', component: resolve => require(['@/components/pages/sys/test/index.vue'], resolve),meta: { title: '测试菜单',requireAuth:true}}
          ]
    },
    { 
      path:'/login', 
      name:'login', 
      component: resolve => require(['@/components/pages/login.vue'], resolve) 
    },
    {
      path:'/error', 
      name:'error', 
      component: resolve => require(['@/components/pages/error.vue'], resolve) 
    },
    {
      path:'/404', 
      name:'404', 
      component: resolve => require(['@/components/pages/404.vue'], resolve) 
    },
    {
      path:'/403', 
      name:'403', 
      component: resolve => require(['@/components/pages/403.vue'], resolve) 
    },
    {
        path:'/test', 
        name:'test', 
        component: resolve => require(['@/components/test/test.vue'], resolve) 
      },
    {
        path: '*',
        redirect: '/404'
    }
  ]
})
